package com.esyoga.yoyoga.service.impl;

import com.esyoga.yoyoga.mapper.TPlatformMapper;
import com.esyoga.yoyoga.pojo.TPlatform;
import com.esyoga.yoyoga.pojo.TPlatformExample;
import com.esyoga.yoyoga.pojo.TStudent;
import com.esyoga.yoyoga.pojo.TStudentExample;
import com.esyoga.yoyoga.service.PlatformVerifyService;
import lombok.Data;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 场馆验证
 * @author YangTao
 */
@Data
@Service
public class PlatformVerifyServiceImpl implements PlatformVerifyService {
    @Resource
    private TPlatformMapper tPlatformMapper;
    /**
     * 通过账号查场馆
     *
     * @param account
     * @return
     */
    @Override
    public TPlatform findPlatformByAccount(String account) {
        TPlatform tPlatform = null;
        TPlatformExample tPlatformExample = new TPlatformExample();
        //通过Criteria构造查询条件
        TPlatformExample.Criteria criteria = tPlatformExample.createCriteria();
        criteria.andPAccountEqualTo(account);
        List<TPlatform> list = tPlatformMapper.selectByExample(tPlatformExample);
        System.out.println(list);
        if(list.size()!=0){
                tPlatform = list.get(0);
        }
        return tPlatform;
    }
}
